<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center kaoqinjilu_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub kaoqinjilu_fd0_0'>
          <view class='flex flex-wrap align-center kaoqinjilu_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  kaoqinjilu_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='kaoqinjilu_fd0_0_c1_c0'>考勤记录</text>
          </view>
          <view class='flex flex-wrap align-center justify-end kaoqinjilu_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view class='flex flex-wrap align-center justify-center kaoqinjilu_fd1_0'>
          <!-- <benben-sign-card ref="benbenSignCardfd2_2" class='signinPage_fd2_2' :sign-data="calendar.data"
            :current-month.sync="month" key-name="create_time" @change="getcalendarFunc">
            <template #head="{currentDate}">
              <view class='flex flex-wrap align-center self-center justify-center signinPage_fd2_2_c0'>
                <text class='fu-iconfont2  signinPage_fd2_2_c0_c0'
                  @tap.stop="$refs.benbenSignCardfd2_2.onSwitchPrevMonth()">&#xe8ef;</text>
                <text>{{currentDate}}</text>
                <text class='fu-iconfont2  signinPage_fd2_2_c0_c0'
                  @tap.stop="$refs.benbenSignCardfd2_2.onSwitchNextMonth()">&#xe8f0;</text>
              </view>
            </template>
          </benben-sign-card> -->
          <ren-calendar ref='ren' :markDays='markDays' :open="true" :disabledAfter='true'
            @onDayClick='onDayClick'></ren-calendar>
        </view>
        <!-- <view class='flex flex-direction align-stretch justify-center kaoqinjilu_fd1_0'>
          <text class='kaoqinjilu_fd1_1_c0'>上班{{info.up_time}}</text>
          <text class='kaoqinjilu_fd1_1_c1'
            :class="info.up_flag ? 'active' : ''">{{info.up_flag ? '已打卡' : '未打卡'}}</text>
        </view> -->
        <view class='flex flex-direction align-stretch justify-center kaoqinjilu_fd1_0' v-for="(item,index) in dataList"
          :key="index">
          <text class='kaoqinjilu_fd1_1_c0'>{{item.dakazhuangtai_name}}
            <text>{{item.dakazhuangtai==1 ? item.shangbandakashijian :item.xiabandakashijian}}</text>

          </text>
          <view class='flex flex-wrap align-center kaoqinjilu_fd1_2_c1'>
            <text class='kaoqinjilu_fd1_2_c1_c0'
              :class="item.checked  ? 'active' : ''">{{item.checked? '已打卡' : '未打卡'}}</text>
            <text class='kaoqinjilu_fd1_2_c1_c1'>{{item.dakadidian}}</text>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <benben-popup v-model="popupShow1713840324246" :mask="true" :mask-close-able="false" mode='center'>
        <!---flex布局flex布局开始-->
        <view class="flex align-center justify-center benben-flex-layout">
          <image class='kaoqinjilu_fd2_0' mode="aspectFit" :src='STATIC_URL+"157.png"'></image>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>


    </view>
  </view>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        "popupShow1713840324246": false,
        "calendar": {
          "user_id": "",
          "days": "",
          "create_time": "",
          "today": "",
          "score": "",
          "sign_total": "",
          "week_sign_info": [],
          "total": "",
          "per_page": "",
          "current_page": "",
          "last_page": "",
          "data": []
        },
        "month": "",
        dataList: [],
        riqi: '',
        info: '',
        curDate: '',
        markDays: []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      var timeStamp = new Date();
      this.riqi = this.$util.timeFormat(timeStamp)
      this.getData()
    },
    onUnload() {

    },
    onReady() {
      let today = this.$refs.ren.getToday().date;
      this.curDate = today;
      // this.markDays.push(today);
      // console.log('markDays', this.markDays)
    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      onDayClick() {},
      getcalendarFunc(e) {
        console.log('monthmont222hmonthmonth', e)
        const str = e.month.toString();
        const array = [...str];
        let str1 = ''
        let array1 = []
        if (e.day) {
          str1 = e.day.toString();
          array1 = [...str1];
        }
        if (array.length == 1) {
          e.month = `0${e.month}`
        }
        if (array1.length == 1) {
          e.day = `0${e.day}`
        }
        if (e.day) {
          this.riqi = `${e.year}-${e.month}-${e.day}`
        } else {
          this.riqi = `${e.year}-${e.month}`
        }

        this.$api.post(global.apiUrls.post6628a388c4eba, {
          riqi: this.riqi
        }).then(res => {
          if (res.data.code == 1) {
            this.dataList = res.data.data.list
            this.info = res.data.data
            this.getData()
          }
        })

      },
      getList() {
        this.$api.post(global.apiUrls.post6628a388c4eba, {
          riqi: this.riqi
        }).then(res => {
          if (res.data.code == 1) {
            this.dataList = res.data.data.list
            this.info = res.data.data
          }
        })
      },
      getData() {
        let start_time = this.riqi.split('-')
        this.$api.post(global.apiUrls.post64192099543cf, {
          riqi: this.riqi,
          start_time: start_time[0] + '-' + start_time[1]
        }).then(res => {
          if (res.data.code == 1) {
            this.calendar = res.data.data
            this.markDays = res.data.data
            console.log('mar11111', this.markDays)
            this.getList()
          }
        })
      },
    }
  };
</script>
<style lang="scss" scoped>
  .signinPage_flex_0 {
    // background: url(image-path('207.png')) no-repeat, transparent;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .signinPage_fd0_0_c2_c0 {
    color: var(--benbenFontColor3);
  }

  .signinPage_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 600;
    color: var(--benbenFontColor3);
  }

  .signinPage_fd0_0_c0_c0 {
    font-size: 32rpx;
    font-weight: 500;
    color: var(--benbenFontColor3);
  }

  .signinPage_fd0_0_c0 {
    width: 180rpx;
  }

  .signinPage_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .signinPage_fd1_1 {
    width: 56rpx;
    height: 56rpx;
    border-radius: 28rpx 28rpx 28rpx 28rpx;
  }

  ::v-deep .signinPage_fd1_0_c1_c0 {
    width: 480rpx;
  }

  .signinPage_fd1_0_c1 {
    touch-action: none;
    height: 330rpx;
    width: 480rpx;
  }

  .signinPage_fd1_0_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: rgba(51, 51, 51, 1);
    margin: 200rpx 0rpx 32rpx 0rpx;
  }

  .signinPage_fd1_0 {
    // background: url(image-path('208.png')) no-repeat, #fff;
    width: 560rpx;
    background-size: 100% auto !important;
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    padding: 28rpx 32rpx 45rpx 32rpx;
    margin: 0rpx 0rpx 40rpx 0rpx;
  }

  .signinPage_flex_2 {
    padding: 50rpx 0rpx 0rpx 0rpx;
  }

  .signinPage_fd2_3_1 {
    background: var(--benbenbgColor7);
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 588rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    margin: 40rpx 0rpx 40rpx 0rpx;
  }

  .signinPage_fd2_3 {
    background: var(--benbenbgColor7);
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 588rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    margin: 50rpx 0rpx 40rpx 0rpx;
  }

  .signinPage_fd2_2_c0_c0 {
    padding: 0rpx 15rpx 0rpx 15rpx;
  }

  .signinPage_fd2_2_c0 {
    // background: var(--benbenbgColor7);
    height: 80rpx;
    background-size: 100% auto !important;
    width: 400rpx;
    margin: 0rpx auto 32rpx auto;
    border-radius: 44rpx;
    color: #333333;
  }

  .signinPage_fd2_2 {
    background: var(--benbenbgColor1);
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    margin: 0rpx 32rpx 0rpx 32rpx;
    padding: 32rpx 0rpx 0rpx 0rpx;
  }

  .signinPage_fd2_1 {
    margin: 48rpx 0rpx 300rpx 0rpx;
    font-size: 32rpx;
    font-weight: 700;
    color: var(--benbenFontColor3);
    line-height: 50rpx;
  }

  .signinPage_fd2_0 {
    font-size: 40rpx;
    font-weight: 700;
    color: var(--benbenFontColor3);
    line-height: 60rpx;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .kaoqinjilu_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .kaoqinjilu_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .kaoqinjilu_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .kaoqinjilu_fd0_0_c0 {
    width: 120rpx;
  }

  .kaoqinjilu_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .kaoqinjilu_fd1_2_c1_c1 {
    font-size: 28rpx;
    color: rgba(102, 102, 102, 1);
    margin: 0rpx 0rpx 0rpx 24rpx;

    &.active {
      color: rgba(0, 137, 255, 1);
    }
  }

  .kaoqinjilu_fd1_2_c1_c0 {
    color: rgba(102, 102, 102, 1);

    &.active {
      color: rgba(0, 137, 255, 1);
    }

  }

  .kaoqinjilu_fd1_2_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .kaoqinjilu_fd1_1_c1 {
    font-size: 28rpx;
    color: rgba(102, 102, 102, 1);
    margin: 12rpx 0rpx 0rpx 0rpx;

    &.active {
      color: rgba(0, 137, 255, 1);
    }
  }

  .kaoqinjilu_fd1_1_c0 {
    font-weight: 600;
  }

  .kaoqinjilu_fd1_0 {
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    width: 710rpx;
    margin: 24rpx auto 24rpx auto;
    padding: 24rpx;
    border-radius: 16rpx;
  }

  .kaoqinjilu_fd2_0 {
    width: 640rpx;
    height: 697rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }
</style>
